@extends("admins/mainLayouts")
@section("body-main")
    <div class="layui-body">
        <!-- 内容主体区域 -->
        <div style="padding: 15px;">
            <!--blockquote class="layui-elem-quote">
               11111111111111111
            </blockquote-->
            <iframe src="{{ url('/admins/welcome') }}" frameborder="0" width="100%" id="mainIframe" name="mainIframe" scrolling="no" >

            </iframe>
        </div>
    </div>

    <script src="/static/js/jquery/jquery-3.2.1.min.js"></script>
    <script type="text/javascript">
            function reinitIframe(){
                var iframe = document.getElementById("mainIframe");
                try{
                    var bHeight = iframe.contentWindow.document.body.scrollHeight;
                    var dHeight = iframe.contentWindow.document.documentElement.scrollHeight;
                    //var height = Math.max(bHeight, dHeight);
                    iframe.height = bHeight;
                    console.log(dHeight);

                }catch (ex){}
            }
            function SetCwinHeight(){
                var iframeid=document.getElementById("mainIframe"); //iframe id
                if (document.getElementById){
                    if (iframeid && !window.opera){
                        if (iframeid.contentDocument && iframeid.contentDocument.body.offsetHeight){
                            iframeid.height = iframeid.contentDocument.body.offsetHeight;
                        }else if(iframeid.Document && iframeid.Document.body.scrollHeight){
                            iframeid.height = iframeid.Document.body.scrollHeight;
                        }
                    }
                }
            }
            $(document).ready(function(){

            });
            function myfunSetHeight()
            {
                var iframeHeight = $("#mainIframe").contents().find("body").height();
                $("#mainIframe").height(iframeHeight+120);//多加120个像素
            }

        window.setInterval("myfunSetHeight()", 1000);
    </script>


@endsection


